<template>
<transition name="fade">
  <div class="box">
    <header class="order-header">
      <router-link tag="span" :class="item.icon" :to="item.path" v-for="(item, index) of list" :key="index"></router-link>
      <span>我的订单</span>
    </header>
    <div class="order-content">
      <ul class="order-content-ul">
        <li v-for="(order, orderindex) of orderlist" :key="orderindex">
          <div class="order-content-ul-pro">
            <a :class="order.icon"></a>
          </div>
          <router-link tag="span" :to="order.path">{{order.pdesc}}</router-link>
        </li>
      </ul>
    </div>
  </div>
</transition>
</template>

<script>
import Vue from 'vue'
import axios from 'axios'
import Qs from 'qs'
import { Swipe, SwipeItem, Lazyload } from 'mint-ui'
Vue.use(Swipe, SwipeItem, Lazyload)
export default {
  data () {
    return {
      list: [
        {
          path: '/mine',
          icon: 'iconfont icon-fanhui2'
        }
      ],
      orderlist: [
        {
          path: '/orderall',
          pdesc: '全部',
          icon: 'iconfont icon-dingdan'
        },
        {
          path: '/ordermoney',
          pdesc: '待付款',
          icon: 'iconfont icon-unie64c'
        },
        {
          path: '/ordergoods',
          pdesc: '待收货',
          pprice: '29.9',
          icon: 'iconfont icon-daishouhuo1'
        },
        {
          path: '/ordersend',
          pdesc: '待发货',
          icon: 'iconfont icon-weibiaoti2fuzhi05'
        },
        {
          path: '/ordercomplete',
          pdesc: '已完成',
          icon: 'iconfont icon-trues'
        },
        {
          path: '/ordercomment',
          pdesc: '评价',
          icon: 'iconfont icon-pingjia2'
        },
        {
          path: '/ordersale',
          pdesc: '退款/售后',
          icon: 'iconfont icon-shouhoutuikuan'
        }
      ]
    }
  },
  computed: {
  },
  created () {
    let data = {
      token: '7qwN83Y2xI2xasQikfLHvwFwLQKxxk5wZyi6Ej+So2Vx1864is3FP2c+zr18HzNAC7fzHZHbmLDWwJraATqJ+cjyp9aSekyCKPoiVit0kHqEJYNu3/HhVAqSW1YJBo9GtG4aH2RSdJ194HC4Slo8wLMBKgvd61ZSGeyJJ80HEnPtUff6/csmpBFsSlXoVRN+DygYwJsRRi2im1HkL0zDJr9GL1nJSxfJLr2+3dEGuEGyDJYuS6aGVaSzY7BCGX2OBspUNJw5BuYR/t3hvUWPCYbfCSehfNHALihJVTJ39LLJ9d/uyc4ciyBA5ZbusTst'
    }
    axios({
      method: 'post',
      url: 'http://localhost:8081/orderinfo.do',
      data: Qs.stringify(data)
    })
      .then((res) => {
        console.log(res)
      })
      .catch(function (error) {
        console.log(error)
      })
  }
}
</script>

<style lang="scss">
// 头部
.order-header{
  width:3.75rem;
  height:0.42rem;
  line-height:0.42rem;
  background:rgb(236, 234, 234);
  text-align: center;
  span{
    &:nth-child(1){
     font-size:0.16rem;
     float:left;
     font-weight: 700;
     margin-left:0.15rem;
    };
    &:nth-child(2){
      display:block;
      font-size:0.14rem;
      float:left;
       margin-left:1.3rem;
    }
  }
}
// 商品展示部分
.order-content{
  overflow-y:scroll;
  flex:1;
  .order-content-ul{
      width:3.75rem;
      flex:1;
      background:0;
      display: flex;
      justify-content: space-between;
      flex-wrap: wrap;
      li{
        width:100%;
        height:0.66rem;
        line-height:0.66rem;
        box-sizing: border-box;
        display: flex;
        border-bottom:1px solid #ccc;
        .order-content-ul-pro{
            width:0.35rem;
            height:0.35rem;
            margin-left:0.2rem;
            a{
              font-size:0.3rem;
              text-decoration: none
            }
        }
        span{
          display: block;
          margin-left:0.15rem;
          font-size: 0.16rem;
        }
      }
    }
}

</style>
